import pygame, os

import gamecontroller
class GameView:
    def __init__(self, gameEngine):
        self.ge = gameEngine
        pygame.init()
        self.window = pygame.display.set_mode((self.ge.width, self.ge.height))
        pygame.display.set_caption('XBAX PIRUETT 2 PI')
        self.screen = pygame.display.get_surface()

        # Tills vi har skrivit en STAGE eller LEVEL-klass med denna data
        self.space_bg = pygame.image.load(os.path.join("img","space.png"))


    def update(self):
        self.screen.blit(self.space_bg, (0,0))
        for item in self.ge.gameObjects:
            self.screen.blit(item.surface, (item.x, item.y))
        for item in self.ge.gameHazards:
            self.screen.blit(item.surface, (item.x, item.y))

        pygame.display.flip()
